package cs4game;

public class Player extends MobEntity{
	
	boolean dead = false;
	
	public Player(){
		//this.visible = false;
	}
	
	

	public Player(Vector3D point3d, World world) {
		super(point3d, world);
		//this.visible = false;
		width = height = depth = 0.6f;
		height = 0f;
		box = new BoundingBox(-1*width/2, width/2, -1*height/2, height/2, -1*depth/2, depth/2);
		//prevHeight = p.y;
	}



	protected void defineTexture() {
		texture = BlockDefs.get4DFromTerrain(0, 3, 0.6 );
	}

	public void shootBullet(float angle) {
		float[] v = new float[3];
		v[0] = (float) (10*Math.cos(angle));
		v[1] = 0;
		v[2] = (float) (10*Math.sin(angle));
		Vector3D copyPos = pos.copy();
		copyPos.x-=width/2 - .3f;
		copyPos.y-=height/4;
		copyPos.z-=depth/2 - .3f;
		Bullet b = new Bullet(world, copyPos, v);
		world.addEntity(b);
	}
	
	public void kill(){
		world.removeEntity(this);
		dead = true;
	}
}
